import Mock from 'mockjs'

const qian = Mock.mock({
  "list|30-55": [
    {
      "title": "@ctitle",
      "content": '@cparagraph()',
      "number1|1-99": 1,
      "number2|1-99": 1,
      "number3|1-99": 1,
      id: '@increment()',
      time: '@date(yyyy-MM-dd)',
    }
  ]
})

Mock.mock('/upl', 'post', () => {
  return qian
})

const attention = Mock.mock({
  "list|0-80": [
    {
      "name": "@cname",
      id: '@increment()',
      ime2: '@date(yyyy-MM-dd hh:mm:ss)'
    }
  ]
})

Mock.mock('/attention', 'post', () => {
  return attention
})

const fans = Mock.mock({
  "list|0-80": [
    {
      "name": "@cname",
      id: '@increment()',
      ime2: '@date(yyyy-MM-dd hh:mm:ss)'
    }
  ]
})

Mock.mock('/fans', 'post', () => {
  return fans
});


/**
 * 数据
 * name
 * title
 * contenter
 * ifattention
 * ifpeaise
 * time
 */
const artices = Mock.mock({
  "list|80-90": [
    {
      name: "@cname()",
      title: "@ctitle(0, 50)",
      "contenter": '@cparagraph(10, 15)',
      "ifattention|0-1": 1,
      "ifpeaise|0-1": 1,
      time: '@date(yyyy-MM-dd)',
      id: '@increment()',
      "ifshoucang|0-1": 1,
      "num1|0-3000": 1,
      "num2|0-3000": 1,
      "num3|0-3000": 1,
      "num4|0-3000": 1,
      "num5|0-30000": 1
    }
  ]
})


Mock.mock('/artices', 'post', () => {
  return artices
});


const muchartice = Mock.mock({
  "list|5": [
    {
      title: "@ctitle(0, 30)",
      "num1|0-3000": 1
    }
  ]
})

Mock.mock('/muchartice', 'post', () => {
  return muchartice
});